<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<div class="pic">
		<img src="../image/1-small.jpg" alt="">
		<img src="../image/2-small.jpg" alt="">
		<img src="../image/3-small.jpg" alt="">
	</div>

	<input type="button" value="我是按钮" id="btn">

	<script>

		var imgs = document.getElementsByTagName('img');

		var btn = document.getElementById('btn');


		for(var i=0;i<imgs.length;i++){
				// console.log(imgs[i])
				imgs[i].onclick = function(){
					this.width= '300';
				}
			}


			btn.onclick = function(){

				// btn.value = "被修改了"
				// var newVal = btn.value;

				// btn.value= "修改了"

				if(this.value == "我是按钮"){
					this.value= "修改了"
				}else{
					this.value= "我是按钮"

				}
			}




		</script>
	</body>
	</html>